﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using TankeWar.Properties;

namespace TankeWar
{
    internal class SoundManager
    {
        //SoundPlayer音频播放器
        //启动
        private static SoundPlayer startPlayer = new SoundPlayer();
        //添加
        private static SoundPlayer addPlayer = new SoundPlayer();
        //爆炸
        private static SoundPlayer blastPlayer = new SoundPlayer();
        //开火
        private static SoundPlayer firePlayer = new SoundPlayer();
        //击中
        private static SoundPlayer hitPlayer = new SoundPlayer();

        //设置音频的初始化
        public static void initSound()
        {
            startPlayer.Stream = Resources.start;
            addPlayer.Stream = Resources.add;
            blastPlayer.Stream = Resources.blast;
            firePlayer.Stream = Resources.fire;
            hitPlayer.Stream = Resources.hit;

        }

        public static void PlayStart()
        {
            startPlayer.Play();
        }
        public static void PlayAdd()
        {
            addPlayer.Play();
        }
        public static void PlayBlast()
        {
            blastPlayer.Play();
        }
        public static void PlayFire()
        {
            firePlayer.Play();
        }
        public static void PlayHit()
        {
            hitPlayer.Play();
        }

    }
}
